﻿@{
    Layout = null;
}
@model ElingOA6_Admin_DSJCJ.Areas.Admin.Models.DocumentPubEditViewModel
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>信息发布</title>
    @Html.Partial("LoadPanelPartial")
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
        <script src="../../../../Scripts/json2.js" type="text/javascript"></script>  
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui-tabs.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Fckeditor/fckeditor.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/CJL.0.1.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/ImagePreview.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/ntko.js", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

    new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
    )
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script>

        /*全局变量*/
        $(document).ready(function () {
            $("#toolMenu").smartFloat();

            var opMethod = $("#hdMethod").val();
            if (opMethod == "EDIT") {//修改
                var clientrdEditModeObj = ASPxClientRadioButtonList.Cast("rdEditMode");
                var editModeValue = clientrdEditModeObj.GetValue();
                if (editModeValue == "0") {
                    //HTML

                }
                else {
                    //office
                    var url = $("#hdUrl").val();
                    var newofficetype = $("#hdNewofficetype").val();
                    editoffice(url, newofficetype);
                }
                //附件
                var attachList = $("#hdAttachJsonString").val();
                if (attachList != "") {
                    attachList = JSON.parse(attachList);
                }
                else {
                    attachList = null;
                }
                if (attachList != null) {
                    for (var i = 0; i < attachList.length; i++) {

                        $("#tableOldAttach").append("<tr id='trOldAttach" + i + "'><td> <a href='###' style='color:Red; font-size:12px' onclick='delOldFile(\"" + attachList[i].attachID + "\"," + i + ")' >[删除]</a>"
                    + "&nbsp;&nbsp;&nbsp;<a  target='_blank' href='" + attachList[i].atthref + "' font-size:12px' >" + attachList[i].title + "</a>"
                    + "&nbsp;&nbsp;&nbsp;" + attachList[i].desc
                    + "</td></tr>");
                    }
                }
                //通知对象
                addRecObject();
                //信息合发部门
                addJoinDeptUser();
            }
            else {
                FDocTemplate_ValueChanged();
            }
        });
        /*删除现有文件*/
        function delOldFile(attachID, rowIndex) {
            if (confirm("确定删除该附件吗？")) {
                $.ajax({
                    type: "POST",
                    url: rootPath + "/Admin/DocumentPub/DeleteDocAttach",
                    data: { attachID: attachID },
                    async: true,
                    success: function (jsonstr) {
                        var msg = jsonstr.split('|');
                        if (msg[0] == "SUCCESS") {
                            alert("删除成功");
                            $("tr[id='trOldAttach" + rowIndex + "']").remove(); //删除当前行
                        }
                        else {
                            if (msg.length > 1) {
                                alert(msg[1]);
                            }
                        }
                    }
                });
            }
        }
        function getDefaultValue() {
            if ($("#hdWaterMarkType").val() != "") {
                if ($("#hdWaterMarkType").val() == "1") {
                    return "V2"; //图片
                }
                else {

                    return "V1"; //文本
                }
            }
            else {
                return "";
            }
        }
        /*FCK只读*/
        function FCKeditor_OnComplete(editor) {
            editor.EditorDocument.body.contentEditable = false;
        }
        /*编辑模式改变*/
        function rdEditMode_ValueChanged(s, e) {
            if ($("#hdDocClsCd").val() != "") {
                var clientrdEditModeObj = ASPxClientRadioButtonList.Cast(s);
                var editModeValue = clientrdEditModeObj.GetValue();
                var editModeType = "O";
                switch (editModeValue) {
                    case "0":
                        {
                            //HTML

                            $("#divOffictControl").css("display", "none");
                            $("#divFck").css("display", "block");

                            var oFCKeditor = new FCKeditor('fck1');
                            oFCKeditor.BasePath = rootPath + "/Fckeditor/";
                            oFCKeditor.ToolbarSet = "DocRead";
                            oFCKeditor.Height = 400;

                            oFCKeditor.ReplaceTextarea();

                            editModeType = "H";
                            break;
                        }
                    case "1":
                        {
                            //WORD
                            $("#divOffictControl").css("display", "block");
                            $("#divFck").css("display", "none");
                            editoffice("", "1");

                            break;
                        }
                    case "2":
                        {
                            //EXCEL
                            $("#divOffictControl").css("display", "block");
                            $("#divFck").css("display", "none");
                            editoffice("", "2");

                            break;
                        }
                    case "3":
                        {
                            //PPT
                            $("#divOffictControl").css("display", "block");
                            $("#divFck").css("display", "none");
                            editoffice("", "3");

                            break;
                        }
                }
                var clientFDocTemplateObj = ASPxClientComboBox.Cast("FDocTemplate");
                var templateDefaultValue = $("#hdTemplateDefaultValue").val();
                $("#hdTemplateDefaultValue").val("");
                //绑定模板下拉数据
                $.ajax({
                    type: "GET",
                    url: rootPath + "/Admin/DocumentPub/GetTemplateString",
                    data: "docClsCd=" + $("#hdDocClsCd").val() + "&editMode=" + editModeType,
                    success: function (result) {
                        if (result != "") {
                            var modelList = JSON.parse(result);
                            clientFDocTemplateObj.ClearItems();
                            var isDefault = false;
                            for (var i = 0; i < modelList.length; i++) {
                                clientFDocTemplateObj.AddItem(modelList[i].Text, modelList[i].Value, "");
                                if (templateDefaultValue != "" && templateDefaultValue == modelList[i].Value) {
                                    isDefault = true;
                                }

                            }
                            if (isDefault == true) {
                                clientFDocTemplateObj.SetValue(templateDefaultValue);
                            }
                            else {
                                clientFDocTemplateObj.SetValue("-1");
                            }
                        }

                    }
                });
            }

        }

        function rdPubDept_ValueChanged(s, e) {
            var clientrdPubDeptObj = ASPxClientRadioButtonList.Cast(s);
            var clientcboPubDeptObj = ASPxClientComboBox.Cast("cboPubDept");
            var clientcboPubWorkGroupObj = ASPxClientComboBox.Cast("cboPubWorkGroup");
            var clienttxtChooseJoinDeptUserObj = ASPxClientButtonEdit.Cast("txtChooseJoinDeptUser");
            if (clientrdPubDeptObj.GetValue() == "0") {
                //部门
                clientcboPubDeptObj.SetVisible(true);
                clientcboPubWorkGroupObj.SetVisible(false);
                clienttxtChooseJoinDeptUserObj.SetEnabled(true);
            }
            else {
                //工作组
                clientcboPubDeptObj.SetVisible(false);
                clientcboPubWorkGroupObj.SetVisible(true);
                clienttxtChooseJoinDeptUserObj.SetText("");
                $("#hdSelJoinDeptUserKeys").val("");
                clienttxtChooseJoinDeptUserObj.SetEnabled(false);
            }
        }

        /*初始化设置通知对象*/
        function addRecObject() {
            var clienttxtUserObj = ASPxClientButtonEdit.Cast("txtChooseUser");
            var returnValue = $("#hdSelRecObjectKeys").val();
            if (returnValue != "") {
                var list = JSON.parse(returnValue);
                var treeModelList = list[0];
                var userString = "";
                if (treeModelList.length > 0) {
                    userString += "部门人员:";
                    for (var i = 0; i < treeModelList.length; i++) {
                        userString += treeModelList[i].Text + ",";
                    }
                    userString = userString.substr(0, userString.lastIndexOf(','));
                    userString += ";";
                }
                treeModelList = list[1];
                if (treeModelList.length > 0) {
                    userString += "工作组人员:";
                    for (var i = 0; i < treeModelList.length; i++) {
                        userString += treeModelList[i].Text + ",";
                    }
                    userString = userString.substr(0, userString.lastIndexOf(','));
                }
                clienttxtUserObj.SetValue(userString);
            }
            else {
                clienttxtUserObj.SetValue("");
            }
        }

        /*增加合发部门人员*/
        function addJoinDeptUser() {
            var returnValue = $("#hdSelJoinDeptUserKeys").val();
            var clienttxtChooseJoinDeptUserObj = ASPxClientButtonEdit.Cast("txtChooseJoinDeptUser");
            if (returnValue != "") {
                var treeModelList = JSON.parse(returnValue);
                var userString = "";
                for (var i = 0; i < treeModelList.length; i++) {
                    userString += treeModelList[i].Text + ",";
                }
                userString = userString.substr(0, userString.lastIndexOf(','));
                clienttxtChooseJoinDeptUserObj.SetValue(userString);
            }
            else {
                clienttxtChooseJoinDeptUserObj.SetValue("");
            }
        }

        //图片预览
        function previewImg() {
            var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
            if (clientlogoUploadObj.GetText() != "") {
                var ip = new ImagePreview($$("logoUpload_TextBox0_Input"), $$("imgLogo"), {
                });
                ip.img.src = ImagePreview.TRANSPARENT;
                ip.preview();
            }
            else {
                $("#imgLogo").attr("src", "");
            }
            $('#imgLogo').css("height", "100px");
            $('#imgLogo').css("width", "100px");
        }
        /*缩略图*/
        function isPicNews_ValueChanged(s, e) {
            var clientFIsPicNewsObj = ASPxClientCheckBox.Cast(s);
            var clientcboThumbGenTypeObj = ASPxClientComboBox.Cast("cboThumbGenType");
            var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
            var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
            var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
            if (clientFIsPicNewsObj.GetChecked()) {
                clientcboThumbGenTypeObj.SetEnabled(true);
                clientchkTQTPDZObj.SetEnabled(true);
                clientchkTQTPDZObj.SetChecked(true);
                clientFThumbSeqIDObj.SetEnabled(true);
                clientFThumbSeqIDObj.SetValue("1");
            }
            else {
                clientcboThumbGenTypeObj.SetEnabled(false);
                clientchkTQTPDZObj.SetEnabled(false);
                clientFThumbSeqIDObj.SetEnabled(false);
                clientlogoUploadObj.ClearText();
                clientlogoUploadObj.RemoveFileInput(0);
                clientcboThumbGenTypeObj.SetValue("1");
                clientchkTQTPDZObj.SetChecked(false);
                clientFThumbSeqIDObj.SetText("");
                $("#imgLogo").attr("src", "");
            }

        }
        /*选择缩略图产生方式*/
        function cboThumbGenType_ValueChanged() {
            var clientchkSLTObj = ASPxClientCheckBox.Cast("chkSLT");
            if (clientchkSLTObj.GetChecked()) {
                var clientcboThumbGenTypeObj = ASPxClientComboBox.Cast("cboThumbGenType");
                var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
                var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
                var clientlogoUploadObj = ASPxClientUploadControl.Cast("logoUpload");
                if (clientcboThumbGenTypeObj.GetValue() == "1" || clientcboThumbGenTypeObj.GetValue() == "2") {
                    clientchkTQTPDZObj.SetChecked(true);
                    clientFThumbSeqIDObj.SetEnabled(true);
                    clientlogoUploadObj.ClearText();
                    clientlogoUploadObj.RemoveFileInput(0);
                    clientFThumbSeqIDObj.SetValue("1");
                    clientchkTQTPDZObj.SetEnabled(true);
                    $("#imgLogo").attr("src", "");
                }
                else {
                    clientchkTQTPDZObj.SetChecked(false);
                    clientFThumbSeqIDObj.SetEnabled(false);
                    clientFThumbSeqIDObj.SetText("");
                    if (clientlogoUploadObj.GetFileInputCount() == 0) {
                        clientlogoUploadObj.AddFileInput();
                    }
                    clientchkTQTPDZObj.SetEnabled(false);

                }
            }

        }
        /*选择提取图片地址*/
        function chkTQTPDZ_ValueChanged() {
            var clientchkTQTPDZObj = ASPxClientCheckBox.Cast("chkTQTPDZ");
            var clientFThumbSeqIDObj = ASPxClientTextBox.Cast("FThumbSeqID");
            if (clientchkTQTPDZObj.GetChecked()) {
                clientFThumbSeqIDObj.SetEnabled(true);
                clientFThumbSeqIDObj.SetValue("1");
            }
            else {
                clientFThumbSeqIDObj.SetText("");
                clientFThumbSeqIDObj.SetEnabled(false);
            }
        }
        /*判断选择的图片是否正确*/
        function pdPath(xh) {
            var t = 0;
            var r = /^[0-9]*[1-9][0-9]*$/  //正整数
            if (!r.test(xh)) {
                return -2;
            }

            var imgcount = 0;
            var oEditor = FCKeditorAPI.GetInstance("fck1");
            var fckvalue = oEditor.GetXHTML(true);
            t = fckvalue.indexOf("<img");
            while (t != -1) {
                imgcount = imgcount + 1;
                if (imgcount != xh) {
                    t = fckvalue.indexOf("<img", t + 1);
                }
                else {
                    var tlast = fckvalue.indexOf("/>", t);
                    var imgurl = fckvalue.substr(t, tlast + 2 - t); //选择的图片路径
                    var intSrc = imgurl.indexOf("src=\"");
                    var intSrc1 = imgurl.indexOf("\"", intSrc + 5);
                    var strSrc = imgurl.substr(intSrc + 5, intSrc1 - intSrc - 5); //缩略图原图路径"/publish/01/..."
                    document.getElementById("hdSltYLJ").value = strSrc;  //把缩略图路径保存到隐藏域
                    break;
                }
            }

            return t;
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnCancel":
                    {
                        //取消
                        cancel()
                        break;
                    }
            }
        }
        /*取消*/
        function cancel() {
            var pageIndex = $("#hdPageIndex").val();
            var gridDocClsCd = $("#hdGridDocClsCd").val();
            var docType = $("#hdDocType").val();
            if (docType == "PUB") {
                window.location.href = rootPath + "/Admin/DocumentPub/DocumentList?docClsCd=" + gridDocClsCd + "&id=" + pageIndex;
            }
            else {
                if (docType == "MANAGE") {
                    window.location.href = rootPath + "/Admin/DocumentManage/DocumentList?docClsCd=" + gridDocClsCd + "&id=" + pageIndex;
                }
            }
           // 
        }
        
    </script>

</head>
@helper  ReturnBoolValue(int value)
    {
        if (value == 1)
        {
    @:block
        }
        else
        {
    @:none
        }
}
@helper  ReturnBoolValue(string value)
    {
        if (value == "Y" || value == "AUDIT")
        {
    @:block
        }
        else
        {
    @:none
        }
}
<body>
    @using (Html.BeginForm("Save", "DocumentPub", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data", @class = "tableFrom" }))
    {
        <div class="floatToolMenu" id="toolMenu" style="z-index: 99;">
            <iframe style="position: absolute; visibility: inherit; top: 0px; left: 0px; width: 100%; height: 28px; z-index: -1; background-color: #00CCFF; border-width: 0px; filter='progid:dximagetransform.microsoft.alpha(style=0,opacity=0)';"></iframe>
            @Html.DevExpress().Menu(settings =>
       {
           settings.Name = "toolBarMenu";
           settings.ItemAutoWidth = false;
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
           settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);

           settings.Items.Add(item =>
           {
               item.Name = "btnCancel";
               item.Text = "取消";
               item.ItemStyle.ForeColor = System.Drawing.Color.Red;
               item.ClientEnabled = true;
               item.Image.Url = Url.Content("~/Content/ControlImages/cancel.png");

           });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
           settings.ItemLinkMode = ItemLinkMode.ContentBounds;
       }).GetHtml()
        </div>
        <table align="center" class="tableForm">
            <tr>
                <th style="width: 15%">
                    <font color='red'>*</font>@Html.DevExpress().Label(settings => { settings.Text = "信息标题:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FTitle";
                   settings.Width =System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FTitle;
                   settings.ReadOnly = true;
               }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FUseSubTitle)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "副标题:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FSubTitle";
                   settings.Width =System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FSubTitle;
                   settings.ReadOnly = true;
               }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsReferenceNo)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "文号:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FReferenceNo";
                   settings.Width =System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FReferenceNo;
                   settings.ReadOnly = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "作者:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "FAuthor";
                   settings.Width =System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Text = Model.DocumentModel.FAuthor;
                   settings.ReadOnly = true;
               }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsRecObject)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "通知对象:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().ButtonEdit(settings =>
               {
                   settings.Name = "txtChooseUser";
                   settings.Width =System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.ReadOnly = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "编辑模式:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().RadioButtonList(settings =>
               {
                   settings.Name = "rdEditMode";
                   settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
                   settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                   settings.Properties.Style.Border.BorderWidth = 0;
                   settings.Properties.RepeatColumns = 4;
                   settings.Properties.ClientSideEvents.Init = "function(s,e){rdEditMode_ValueChanged(s,e)}";
                   settings.ClientEnabled = false;
               }).BindList(ViewData["editModeSelection"] as List<SelectListItem>).Bind(ViewData["defaultEditMode"]).GetHtml()
                </td>
                <th style="width: 15%; display: none">
                    @Html.DevExpress().Label(settings => { settings.Text = "模板:"; }).GetHtml()
                </th>
                <td style="width: 35%; display: none" class="tdClass">
                    @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "FDocTemplate";

                            settings.Width = 120;
                            settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.EnableClientSideAPI = true;


                        }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsShowHomePageCtrl)">
                <th style="width: 15%">
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsShowHomePage";
                        settings.Checked = Model.DocumentModel.FIsShowHomePage == "Y" ? true : false;
                        settings.ClientVisible = Model.DocClsModel.FIsShowHomePageCtrl == "Y" ? true : false;
                        settings.Text = "在首页中显示";
                        settings.ClientEnabled = false;
                    }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(ViewData["isTop"].ToString())">
                <th style="width: 15%">
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "FIsTop";
                        settings.Checked = Model.DocumentModel.FIsTop == 1 ? true : false;
                        settings.Text = "置顶";
                        settings.ClientEnabled = false;
                    }).GetHtml()
                </td>
            </tr>
            <tr style="display:@ReturnBoolValue(Model.DocClsModel.FIsHomePageShowLimit)">
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "有效期至:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().DateEdit(settings =>
               {
                   settings.Name = "FValidDate";
                   settings.Properties.NullText = "";
                   settings.Properties.DisplayFormatString = "yyyy-MM-dd";
                   settings.Properties.EditFormatString = "yyyy-MM-dd";
                   settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                   settings.ClientEnabled = false;
                   if (Model.DocumentModel.FValidDate.HasValue)
                   {
                       settings.Date = Model.DocumentModel.FValidDate.Value;
                   }

               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "发布部门:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    <table>
                        <tr>
                            <td>
                                @Html.DevExpress().RadioButtonList(settings =>
                           {
                               settings.Name = "rdPubDept";
                               settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
                               settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                               settings.Properties.Style.Border.BorderWidth = 0;
                               settings.Properties.RepeatColumns = 2;
                               settings.ControlStyle.CssClass = "left";
                               settings.Properties.ClientSideEvents.Init = "function(s,e){rdPubDept_ValueChanged(s,e)}";
                               settings.ClientEnabled = false;
                           }).BindList(ViewData["pubItemSelection"] as List<SelectListItem>).Bind(ViewData["defaulRadioChooseValue"]).GetHtml()
                            </td>
                            <td>
                                @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "cboPubDept";

                            settings.Width = 200;
                            settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.EnableClientSideAPI = true;
                            settings.ClientVisible = false;
                            settings.ClientEnabled = false;
                            settings.ControlStyle.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Bottom;


                        }).BindList(ViewData["docPubDeptSelection"] as List<SelectListItem>).Bind(ViewData["defaultPubDept"]).GetHtml()
                                @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "cboPubWorkGroup";

                            settings.Width = 200;
                            settings.Properties.RenderIFrameForPopupElements = DefaultBoolean.True;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.EnableClientSideAPI = true;
                            settings.ClientVisible = false;
                            settings.ControlStyle.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Bottom;
                            settings.ClientEnabled = false;

                        }).BindList(ViewData["docPubWorkGroupSelection"] as List<SelectListItem>).Bind(ViewData["defaultPubWorkGroup"]).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "合发部门:"; }).GetHtml()
                </th>
                <td style="width: 85%" class="tdClass" colspan="3">
                    @Html.DevExpress().ButtonEdit(settings =>
               {
                   settings.Name = "txtChooseJoinDeptUser";
                   settings.Width =System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
                   settings.ReadOnly = true;
               }).GetHtml()
                </td>
            </tr>
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "发布人:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FEmpName; }).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "发布时间:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FPubDate.ToString("yyyy-MM-dd"); }).GetHtml()
                </td>
            </tr>
        </table>
       
        <div id="divFck" style="display: none">
            @Html.TextArea("fck1", Model.DocumentModel.FContentTxt, new { @cols = "30", @rows = "10" })
        </div>
        if (Model.DocClsModel.FEditMode == "A" || Model.DocClsModel.FEditMode == "O")
        {
        @Html.Partial("OfficeControlPartial")
        }
    
        <fieldset style="display:@ReturnBoolValue((int)Model.DocClsModel.FIsPicNews)">
            <legend style="font-size: 12px">
                @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkSLT";
                        settings.Checked = !string.IsNullOrEmpty(Model.DocumentModel.FThumbSrvFileName) ? true : false;
                        settings.Text = "缩略图";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){isPicNews_ValueChanged(s,e)}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){isPicNews_ValueChanged(s,e)}";
                        settings.ClientEnabled = false;
                    }).GetHtml()
            </legend>
            <table class="tableForm">
                <tr>
                    <th style="width: 35%">
                        @Html.DevExpress().Label(settings => { settings.Text = "缩略图产生方式:"; }).GetHtml()
                    </th>
                    <td style="width: 15%" class="tdClass">
                        @Html.DevExpress().ComboBox(
                        settings =>
                        {
                            settings.Name = "cboThumbGenType";

                            settings.Width = 150;
                            settings.Properties.TextField = "Text";
                            settings.Properties.ValueField = "Value";
                            settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                            settings.Properties.EnableAnimation = false;
                            settings.Properties.ClientSideEvents.Init = "function(s,e){cboThumbGenType_ValueChanged(s,e)}";
                            settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){cboThumbGenType_ValueChanged(s,e)}";
                            settings.ClientEnabled = false;
                        }).BindList(ViewData["ThumbGenTypeSelection"]).Bind(Model.DocumentModel.FThumbGenType).GetHtml()
                    </td>
                    <td style="width: 50%" class="tdClass" colspan="2">
                        <table>
                            <tr>
                                <td>
                                    @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkTQTPDZ";
                        //settings.Checked = Model.DocClsModel == 1 ? true : false;
                        settings.Text = "提取图片地址";
                        //settings.Properties.ClientSideEvents.Init = "function(s,e){isPicNews_ValueChanged(s,e)}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkTQTPDZ_ValueChanged(s,e)}";
                        settings.ClientEnabled = false;
                    }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Label(settings => { settings.Text = "第"; }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().TextBox(settings =>
                               {
                                   settings.Name = "FThumbSeqID";
                                   settings.Width = 30;
                                   settings.ClientEnabled = false;
                                   settings.Text = Model.DocumentModel.FThumbSeqID.HasValue ? Model.DocumentModel.FThumbSeqID.Value.ToString() : "";
                                   settings.ClientEnabled = false;
                               }).GetHtml()
                                </td>
                                <td>
                                    @Html.DevExpress().Label(settings => { settings.Text = "张"; }).GetHtml()
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <th style="width: 35%">
                        @Html.DevExpress().Label(settings => { settings.Text = "自定义缩略图:"; }).GetHtml()
                    </th>
                    <td style="width: 15%" class="tdClass" colspan="3">
                        @Html.DevExpress().UploadControl(
                            settings =>
                            {
                                settings.Name = "logoUpload";
                                settings.BrowseButton.Text = "浏览";
                                settings.ClearFileSelectionImage.ToolTip = "清除选择";
                                settings.ShowProgressPanel = false;
                                settings.ValidationSettings.Assign(ElingOA6_Admin_DSJCJ.Common.UploadControlHelper.PicValidationSettings);
                                settings.ShowUploadButton = false;
                                settings.ClientSideEvents.TextChanged = "function(s,e){previewImg()}";
                                settings.ClientVisible = false;
                            }).GetHtml()
                    </td>
                </tr>
                <tr>
                    <th style="width: 15%">
                        @Html.DevExpress().Label(settings => { settings.Text = "图片预览:"; }).GetHtml()
                    </th>
                    <td style="width: 35%" class="tdClass" colspan="3">
                        <img id="imgLogo" src="@Model.DocumentModel.FThumbSrvFileName" />
                    </td>
                </tr>
            </table>
        </fieldset>
        <table class="tableForm" style="display:@ReturnBoolValue(ViewData["docType"].ToString())">
            <tr>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "录用状态:"; }).GetHtml()
                </th>
                <td style="width: 35%" class="tdClass">
                    @Html.DevExpress().RadioButtonList(settings =>
                           {
                               settings.Name = "FIsEnroll";
                               settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Flow;
                               settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                               settings.Properties.Style.Border.BorderWidth = 0;
                               settings.Properties.RepeatColumns = 3;
                               settings.ControlStyle.CssClass = "left";
                               settings.ClientEnabled = false;
                           }).BindList(new List<SelectListItem>(){
                            new SelectListItem(){ Value="Y", Text="录用"} ,
                             new SelectListItem(){ Value="N", Text="未录用"},
                             new SelectListItem(){ Value="", Text="待审核"}, 
                                }).Bind(string.IsNullOrEmpty(Model.DocumentModel.FIsEnroll) ? "" : Model.DocumentModel.FIsEnroll).GetHtml()
                </td>
                <th style="width: 15%">
                    @Html.DevExpress().Label(settings => { settings.Text = "审核人:"; }).GetHtml()
                </th>
                <td style="width: 50%" class="tdClass">
                    <table class="tableForm">
                        <tr>
                            <td style="width: 40%" class="tdClass">
                                @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FStatus == "Y" ? Model.DocumentModel.FAuditEmpName : ""; }).GetHtml()
                            </td>
                            <th style="width: 20%">
                                @Html.DevExpress().Label(settings => { settings.Text = "审核时间:"; }).GetHtml()
                            </th>
                            <td style="width: 40%" class="tdClass">
                                @Html.DevExpress().Label(settings => { settings.Text = Model.DocumentModel.FAuditDate.HasValue ? Model.DocumentModel.FAuditDate.Value.ToString("yyyy-MM-dd HH:mm") : ""; }).GetHtml()
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <fieldset>
            <legend>附件</legend>
            <table id="tableOldAttach" border="0" cellpadding="0" cellspacing="0" align="center" style="width: 95%">
            </table>
        </fieldset>
        @Html.Hidden("hdjsAlert", ViewData["jsAlert"]);//错误信息
        @Html.Hidden("hdMethod", ViewData["hdMethod"]);
        @Html.Hidden("hdDocId", Model.DocumentModel.FDocId);                                              
        @Html.Hidden("hdDocClsCd", Model.DocClsModel.FDocClsCd);
        @Html.Hidden("hdGridDocClsCd", ViewData["gridDocClsCd"]);//表格传递的栏目编号
        @Html.Hidden("hdTemplateDefaultValue", ViewData["templateDefaultVlaue"]);
        @Html.Hidden("hdSelRecObjectKeys", ViewData["recObjectKeys"] == null ? "" : ViewData["recObjectKeys"].ToString());//通知对象
        @Html.Hidden("hdSelJoinDeptUserKeys", ViewData["joinDeptUserKeys"] == null ? "" : ViewData["joinDeptUserKeys"].ToString());//合发单位人员
        @Html.Hidden("hdfckValue", ""); //编辑器内容 
        @Html.Hidden("hdSltYLJ", ""); //缩略图路径 
        @Html.Hidden("hdEditMode", Model.DocumentModel.FEditMode); //编辑模式 H,O 
        @Html.Hidden("hdWaterMarkType", Model.DocClsModel.FIsPicWaterMark == 0 ? "" : Model.DocClsModel.FWaterMarkCls);
        @Html.Hidden("hdAttachJsonString", ViewData["attachJsonString"]);//信息附件显示 
        @Html.Hidden("hdNewofficetype", ViewData["defaultEditMode"] == null ? "" : ViewData["defaultEditMode"].ToString()); //office文件路径   
        @Html.Hidden("hdUrl", ViewData["url"] == null ? "" : ViewData["url"].ToString()); //office文件路径
        @Html.Hidden("hdDocType", ViewData["docType"]);//文档类型  PUB MANAGE AUDIT  
        @Html.Hidden("hdPageIndex", ViewData["pageIndex"]);//当前页                 
    }
</body>
</html>
